package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 地址学校关联表
 *
 * @author wangtao
 * @since 2022-12-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("edu_address_school")
@Schema(name = "EduAddressSchool", title = "地址学校关联表", description = "地址学校关联表实体类")
public class EduAddressSchool extends Model<EduAddressSchool> {

    private static final long serialVersionUID = 1L;

    @Schema(name = "addressSchoolId", title = "地址学校关联id")
    @TableId(value = "address_school_id", type = IdType.ASSIGN_ID)
    private String addressSchoolId;

    @Schema(name = "addressId", title = "地址id")
    @TableField(value = "address_id", updateStrategy = FieldStrategy.NOT_NULL)
    private String addressId;

    @Schema(name = "addressName", title = "地址名称")
    @TableField(value = "address_name")
    private String addressName;

    @Schema(name = "schoolId", title = "学校id")
    @TableField(value = "school_id", updateStrategy = FieldStrategy.NOT_NULL)
    private String schoolId;

    @Schema(name = "schoolName", title = "学校名称")
    @TableField(value = "school_name")
    private String schoolName;

    @Schema(name = "schoolCategory", title = "学校类型（学段）")
    @TableField(value = "school_category")
    private String schoolCategory;

    @Schema(name = "nativeFlag", title = "是否原住居民可读")
    @TableField(value = "native_flag", updateStrategy = FieldStrategy.NOT_NULL)
    private String nativeFlag;

    @Schema(name = "authStatus", title = "审核状态")
    @TableField(value = "auth_status", updateStrategy = FieldStrategy.NOT_NULL)
    private String authStatus;

    @Schema(name = "authRemarks", title = "审核意见")
    @TableField(value = "auth_remarks")
    private String authRemarks;

    @Schema(name = "authTime", title = "审核时间")
    @TableField(value = "auth_time")
    private Date authTime;

    @Schema(name = "authUserId", title = "审核人")
    @TableField(value = "auth_user_id")
    private String authUserId;

    @Schema(name = "serviceAreaFlag", title = "是否服务区 0 否 1是")
    @TableField(value = "service_area_flag", updateStrategy = FieldStrategy.NOT_NULL)
    private String serviceAreaFlag;

    @Schema(name = "areaCode", title = "所属行政区划")
    @TableField(value = "area_code", updateStrategy = FieldStrategy.NOT_NULL)
    private String areaCode;

    @Schema(name = "del", title = "0,未删除,1,已删除")
    @TableField(value = "del", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Schema(name = "createName", title = "创建人")
    @TableField(value = "create_name", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(name = "createTime", title = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(name = "updateName", title = "修改人")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(name = "updateTime", title = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Schema(name = "treeId", title = "edu_address_tree地址叶子节点主键")
    @TableField(value = "tree_id")
    private Long treeId;

    @Schema(name = "auditId", title = "edu_address_school_audit主键，审核表主键")
    @TableField(value = "audit_id")
    private Long auditId;

    @Schema(name = "verificationFlag", title = "是否需要核验：0 否 1是")
    @TableField(value = "verification_flag")
    private String verificationFlag;

    @Schema(name = "auditAuto", title = "自动审核标志，1是0否")
    @TableField(value = "audit_auto")
    private String auditAuto;
    @Override
    public Serializable pkVal() {
        return this.addressSchoolId;
    }
}
